---
title: "Get Total Chats"
api: "GET https://api-v2.opencopilot.so/backend/reports/{orgId}/chats/total"
description: "Retrieve the total number of chat sessions based on specified criteria"
---

This endpoint returns the total count of chat sessions that match the given query parameters. It can be used to analyze chat volume over time, filtered by various attributes such as channel and status.

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

### Path Parameters

<ParamField path="orgId" type="string" required>
  The ID of the organization
</ParamField>

### Query Parameters

<ParamField query="startDate" type="string" format="date-time">
  The start date for the date range filter (ISO 8601 format)
</ParamField>

<ParamField query="endDate" type="string" format="date-time">
  The end date for the date range filter (ISO 8601 format)
</ParamField>

<ParamField query="channel" type="string">
  Filter by the chat channel (e.g., "web", "mobile")
</ParamField>

<ParamField query="status" type="number">
  Filter by the chat session status
</ParamField>

### Response

<ResponseField name="total_chats" type="number">
  The total number of chat sessions matching the specified criteria
</ResponseField>

<RequestExample>

```bash Example Request
curl --location --request GET 'https://api-v2.opencopilot.so/backend/reports/chats/total?startDate=2023-01-01T00:00:00Z&endDate=2023-12-31T23:59:59Z&channel=web&status=1' \
--header 'Authorization: Bearer YOUR_API_KEY'
```

</RequestExample>

<ResponseExample>

```json Response
{
  "total_chats": 1250
}
```

</ResponseExample>